package system.windows

import android.content.Context
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import io.flutter.FlutterInjector
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel

class RecordBoxWindows(
    context: Context, map: Map<*, *>, close: () -> Unit, front: () -> Unit
) {
    var view: View

    init {
        val iconPath = FlutterInjector.instance().flutterLoader()
            .getLookupKeyForAsset(map["iconPath"] as String)
        val fontSize = map["fontSize"] as Int

        view = LayoutInflater.from(context).inflate(R.layout.record_box_layout, null)
//        val closeIcon = layout?.findViewById<ImageView>(R.id.bt_close)
//        closeIcon?.setOnClickListener {
//            close()
//        }
//        val full = layout?.findViewById<ImageView>(R.id.bt_full)
//        full?.setOnClickListener {
//            front()
//        }
//        if (background != null) {
//            addText(background, map["num"] as Int, map["fontSize"] as Int)
//        }


    }


    fun onMethodCall(call: MethodCall, result: MethodChannel.Result): Boolean {
        when (call.method) {
            "updateRecordBoxTime" -> {
                Log.d("updateTime==", "更新录音时间")
                result.success(true)
                return true
            }

            "updateRecordState" -> {
                Log.d("updateState==", "更新录音状态")
                result.success(true)
                return true
            }
        }
        return false
    }


}